package com.igola.appconfig;

import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
public class AppConfigController {
    /**
     * if os is "ios" will find os+version+sign.properties file like this [ios1.1-1.7.properties]
     * if os is "android" will find env+os+version.properties file like this [dev.android1.0.properties]
     *
     * @param parameters {"os":"android","version":"1.0","sign":"DDDD3507BA09122E2CA6D91D7689DD70","environment":"live"}
     * @return api url
     */
    @RequestMapping(value = "/config", method = RequestMethod.POST)
    public @ResponseBody Map greeting(@RequestBody AppConfigParameters parameters) {
        return parameters.properties();
    }
}
